import threading
import time

def work():
    for i in range(10):
        print("子线程工作中")
        time.sleep(0.2)

if __name__ == '__main__':
    sub_thread = threading.Thread(target=work, daemon=True)
    sub_thread.start()

    time.sleep(1)
    print("主线程结束了")

# 结论：主线程会等待所有的子线程执行结束再结束